package com.geekaca.prictic;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;

public class Test02 {
    public static void main(String[] args) {
        Map<String, Integer> employees = new HashMap<>();
        employees.put("张三",800);
        employees.put("李四",1500);
        employees.put("王五",3000);
        employees.put("赵六",900);
        employees.put("陈七",1900);
        employees.put("龙八",1900);
        // 修改张三工资为2600
        employees.put("张三",2600);
        // 所有员工工资加100
       employees.forEach((k,v)-> employees.put(k,employees.get(k)+100));
        System.out.println(employees);
        // 遍历所有员工
        employees.keySet().forEach(emp-> System.out.println(emp));
        // 遍历 所有的工资
        employees.values().forEach(wage-> System.out.println("wage = " + wage));
        // 遍历所有员工和工资
        employees.forEach((k,v)-> System.out.println(k+":"+v));
        System.out.println(employees);

    }
}
